#include<stdlib.h>
#include<stdio.h>
#include<string.h>

#define NameSize 10

struct student   //结构体名
{
     int id;    //学号
     char Name[NameSize];//姓名  
};
typedef struct student stu;

int main()
{
    stu *s=(stu *)malloc(sizeof(stu));
    if(s==NULL)
    {
        printf("malloc 申请空间失败!\n");
        return -1;
    }
    s->id=10;
    strcpy(s->Name,"zhangsan");
    printf("%d %s\n",s->id ,s->Name);
    free(s);
    return 0;
}